package com.jishaokang.controller;

import com.jishaokang.base.Result;
import com.jishaokang.model.dto.Comment;
import com.jishaokang.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * Created by NANA_Final on 2019/6/21.
 */

@RestController
@RequestMapping(value = "/api")
public class CommentController {

    @Autowired
    private CommentService commentService;

    @RequestMapping(value = "/user/comment/addComment",method = RequestMethod.POST)
    public Result addComment(@RequestBody Comment comment) {
        return commentService.addComment(comment);
    }

    @RequestMapping(value = "/user/comment/deleteComment",method = RequestMethod.POST)
    public Result deleteComment(@RequestBody Comment comment) {
        return commentService.deleteComment(comment);
    }

    @RequestMapping(value = "/all/comment/selectComment",method = RequestMethod.POST)
    public Result selectComment(@RequestBody Comment comment) {
        return commentService.selectComment(comment);
    }


    @RequestMapping(value = "/examiner/comment/deleteComment",method = RequestMethod.POST)
    public Result examinerDeleteComment(@RequestBody Comment comment) {
        return commentService.deleteComment(comment);
    }

}